home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pas_0593.zip / CURS-OS2.PAS < prev    next >
Pascal/Delphi Source File  |  1993-05-30  |  2KB  |  56 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 190 of 288                                                               
  3. From : Andres Cvitkovich                   2:310/36.9           25 May 93  23:26 
  4. To   : Michael Harris                      1:216/506.0                           
  5. Subj : Restore Cursor under OS/2-DOS                                          
  6. ────────────────────────────────────────────────────────────────────────────────
  7. Hi Michael,
  8.  
  9. Friday, May 21 1993, Michael Harris wrote to Anyone:
  10.  
  11.  MH> I was wondering if anyone knew a way to remove/restore the cursor in a
  12.  MH> way that will work under regular DOS and OS/2-DOS.  I have tried
  13.  MH> several different ways, all of them work under DOS, but not OS/2.
  14.  MH> Well, let me clarify that - they all can make the cursor go away under
  15.  MH> OS/2-DOS, but none of them have been successful in bringing it back.
  16.  MH> Any help would be greatly appreciated, because I always like my
  17.  MH> programs to work under OS/2-DOS as well as DOS for the convenience of
  18.  MH> the OS/2 users out there (myself included).
  19.  
  20. no problem at all:  ;-)
  21.  
  22.  
  23. >-----------------------------------------------------------}
  24. Procedure CursorOff; Assembler;
  25. Asm
  26.     Push BP
  27.     Xor  AX, AX
  28.     Mov  ES, AX
  29.     Mov  BH, Byte Ptr ES:[462h]  { get active page }
  30.     Mov  AH, 3
  31.     Int  10h           { get cursor characteristics }
  32.     Or   CH, 32
  33.     Mov  AH, 1
  34.     Int  10h           { set cursor characteristics }
  35.     Pop  BP
  36. End;
  37.  
  38. Procedure CursorOn; Assembler;
  39. Asm
  40.     Push BP
  41.     Xor  AX, AX
  42.     Mov  ES, AX
  43.     Mov  BH, Byte Ptr ES:[462h]  { get active page }
  44.     Mov  AH, 3
  45.     Int  10h           { get cursor characteristics }
  46.     And  CH, 31
  47.     Mov  AH, 1
  48.     Int  10h           { set cursor characteristics }
  49.     Pop  BP
  50. End;
  51. {>-----------------------------------------------------------
  52.  
  53. All you need is TP6 or higher. There are other solutions but this one has the
  54. advantage that you don't depend from the type of graphic card installed. The
  55. cursor is being restored to exactly the same shape it had before.}
  56.